package com.ziyun.pop.modules.storeMaterials.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ziyun.pop.modules.storeMaterials.entity.StoreMaterialInEntity;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import com.ziyun.pop.modules.storeMaterials.dao.StoreMaterialInDetailDao;
import com.ziyun.pop.modules.storeMaterials.entity.StoreMaterialInDetailEntity;
import com.ziyun.pop.modules.storeMaterials.service.StoreMaterialInDetailService;


@Service("storeMaterialInDetailService")
public class StoreMaterialInDetailServiceImpl extends ServiceImpl<StoreMaterialInDetailDao, StoreMaterialInDetailEntity> implements StoreMaterialInDetailService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<StoreMaterialInDetailEntity> page = (Page<StoreMaterialInDetailEntity>)this.page(
                new Query<StoreMaterialInDetailEntity>(params).getPage(),
                new QueryWrapper<StoreMaterialInDetailEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public void saveList(List<StoreMaterialInDetailEntity> storeMaterialInDetailEntityList, StoreMaterialInEntity storeMaterialInEntity) {
        baseMapper.saveList(storeMaterialInDetailEntityList,storeMaterialInEntity);
    }

    @Override
    public void saveListByCG(StoreMaterialInDetailEntity storeMaterialInDetailEntity1, StoreMaterialInEntity storeMaterialInEntity) {
        baseMapper.saveListByCG(storeMaterialInDetailEntity1,storeMaterialInEntity);
    }

    @Override
    public List<StoreMaterialInDetailEntity> getStorematerialByinNo(String inNo) {
        return baseMapper.getStoreMaterialByinNo(inNo);
    }

    @Override
    public BigDecimal getMaterialQuantityByMaterialId(String MaterialId,String inNo) {
        return baseMapper.getStoreMaterialQuantityByMaterialId(MaterialId,inNo);
    }

    @Override
    public List<StoreMaterialInDetailEntity> getInid(Integer inId) {
        return baseMapper.getInId(inId);
    }

    @Override
    public List<StoreMaterialInDetailEntity> getInidAndInNo(String inNoNew, Integer inIdNew) {
        return baseMapper.getInidAndInNo(inNoNew,inIdNew);
    }

    @Override
    public List<StoreMaterialInDetailEntity> getListstorematerialIndetail(Integer inId, String inNo) {
        return baseMapper.getListstorematerialIndetail(inId,inNo);
    }
}
